package com.to8to.thrift.esb.async.example.server;

import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.to8to.thrift.esb.async.example.ServiceA;


public class ServiceAIface implements ServiceA.Iface {
	private Logger logger = LoggerFactory.getLogger(ServiceAIface.class);
	public static String host = "192.168.3.31";
	public static int port = 30000;
	public static int timeout = Integer.MAX_VALUE;
	
//	ThriftClient tcb = new ThriftClient(ServiceB.class.getName(), host, port, timeout);
//	ServiceB.Iface iface_b = (ServiceB.Iface)tcb.getProxy(null);
//	
//	ThriftClient tcc = new ThriftClient(ServiceC.class.getName(), host, port, timeout);
//	ServiceC.Iface iface_c = (ServiceC.Iface)tcc.getProxy(null);
//	
//	ThriftClient tcd = new ThriftClient(ServiceD.class.getName(), host, port, timeout);
//	ServiceD.Iface iface_d = (ServiceD.Iface)tcd.getProxy(null);
	
	
	@Override
	public double valueA(double b, double c, double d) throws TException {
		
//		logger.info("execute valueA({}, {}, {}) method", b, c, d);
//		
//		b = iface_b.valueB(b);
//		
//		c = iface_c.valueC(c);
//		
//		return iface_d.valueD(d, b + c);
		
		return 0;
	}


	@Override
	public double plus(double a, double b) throws TException {
		return a+b;
	}

}
